package com.naiterui.ehp.bs.pharmacist.controller.inner;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.naiterui.ehp.bp.bo.pharmacist.PharmacistInfoBO;
import com.naiterui.ehp.bp.constants.SwaggerTag;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bp.support.exception.PublicService;
import com.naiterui.ehp.bp.support.exception.ResponseVO;
import com.naiterui.ehp.bs.pharmacist.exception.ExceptionCodes;
import com.naiterui.ehp.bs.pharmacist.service.IPharmacistService;
import com.naiterui.ehp.bs.pharmacist.vo.recommend.PharmacistVO;

import io.swagger.annotations.Api;

/**
 * @author guoyongxiang
 * @date 2019/12/6 21:16
 * @since 1.0.0
 */
@RequestMapping("pharmacist/inner/recom")
@RestController
@Api(tags = {SwaggerTag.PHARMACIST + SwaggerTag.INNER_API + SwaggerTag.RECOM})
public class PharmacistInnerRecomController {

    @Autowired
    private IPharmacistService pharmacistService;

    /**
     * 获取指定数量审核药师ID列表
     *
     * @return
     */
    @GetMapping("audit/pharmacist")
    public ResponseVO<List<PharmacistVO>> getAuditPharmacist(Integer count) throws BusinessException {
        List<PharmacistVO> ids = this.pharmacistService.getAuditPharmacist(count);
        return PublicService.returnResponseVO(ExceptionCodes.SUCCESS, ids);
    }

    @RequestMapping("/user/info")
    @ResponseBody
    public ResponseVO<PharmacistInfoBO> getPharmacistInfo(Long pharmacistId) {
        return PublicService.returnResponseVO(ExceptionCodes.SUCCESS, this.pharmacistService.getPharmacistInfo(pharmacistId));
    }

    @PostMapping("/user/list/info")
    public ResponseVO<List<PharmacistInfoBO>> getPharmacistInfoList(@RequestBody List<Long> pharmacistIds) {
        return PublicService.returnResponseVO(pharmacistService.getPharmacistInfoList(pharmacistIds));
    }
}
